package com.Nov_TwentySix;

public class Solution1759 {

    public int countHomogenous(String s) {
        int n=s.length(),k=1;
        long res=1;
        char[] array=s.toCharArray();
        for (int i = 1; i < n; i++) {
            if (array[i]==array[i-1]){
                k++;
            }
            else {
                k=1;
            }
            res+=k;
        }
        return (int) (res%1000000007);
    }

    public static void main(String[] args) {
        Solution1759 solution1759=new Solution1759();
        System.out.println(solution1759.countHomogenous("abbcccaa"));
    }

}
